const mongoos = require("mongoose");
const Schema = mongoos.Schema;

const UserType = {
  username: String,
  password: String,
  gender: Number, //性别 0 未知 1 男 2女
  introduction: String, //简介
  avatar: String,
  role: Number, //角色 1为管理员 2为普通用户
  createTime: Date,
  updateTime: Date,
  deleted: Boolean,//是否删除
};
//user 对应集合名称为 users
const UserModel = mongoos.model("user", new Schema(UserType));

module.exports = UserModel;
